// vite.config.ts
import { fileURLToPath, URL } from 'node:url';
import viteCompression from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/vite-plugin-compression/dist/index.mjs';
import VueSetupExtend from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/vite-plugin-vue-setup-extend/dist/index.mjs';
import eslint from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/vite-plugin-eslint2/dist/index.mjs';
import AutoImport from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/unplugin-auto-import/dist/vite.js';
import Components from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/unplugin-vue-components/dist/vite.js';
import { ElementPlusResolver } from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/unplugin-vue-components/dist/resolvers.js';
import {
  defineConfig,
  loadEnv,
} from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/vite/dist/node/index.js';
import vue from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/@vitejs/plugin-vue/dist/index.mjs';
import vueJsx from 'file:///home/ybw/Project/Vue3-webui/vue3-webui/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs';
import path from 'node:path';
import fs from 'fs';
var __vite_injected_original_dirname =
  '/home/ybw/Project/Vue3-webui/vue3-webui';
var __vite_injected_original_import_meta_url =
  'file:///home/ybw/Project/Vue3-webui/vue3-webui/vite.config.ts';
var vite_config_default = defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd());
  const envName = env.VITE_VUE_APP_ENV_NAME;
  const hasCustomRouter = env.VITE_CUSTOM_ROUTER === 'true' ? true : false;
  const hasCustomAppNav = env.VITE_CUSTOM_APP_NAV === 'true' ? true : false;
  const hasCustomStyle = env.VITE_CUSTOM_STYLES === 'true' ? true : false;
  const alias = {};
  if (envName) {
    if (hasCustomRouter) {
      alias['./routes'] = fileURLToPath(
        new URL(
          './src/env/router/${envName}.ts',
          __vite_injected_original_import_meta_url,
        ),
      );
    }
    if (hasCustomAppNav) {
      alias['./HeaderNavigation'] = fileURLToPath(
        new URL(
          './src/env/components/AppNavigation/${envName}.ts',
          __vite_injected_original_import_meta_url,
        ),
      );
      alias['../AppHeader/HeaderNavigation'] = fileURLToPath(
        new URL(
          './src/env/components/AppNavigation/${envName}.ts',
          __vite_injected_original_import_meta_url,
        ),
      );
    }
    alias['@'] = fileURLToPath(
      new URL('./src', __vite_injected_original_import_meta_url),
    );
  } else {
    alias['@'] = fileURLToPath(
      new URL('./src', __vite_injected_original_import_meta_url),
    );
  }
  return {
    plugins: [
      vue(),
      vueJsx(),
      viteCompression(),
      VueSetupExtend(),
      eslint({
        include: [
          'src/**/*.js',
          'src/**/*.vue',
          'src/**/*.ts',
          'src/*.js',
          'src/*.vue',
          'src/*.ts',
        ],
      }),
      AutoImport({
        imports: [
          // 需要自动导入的插件，自定义导入的API
          'vue',
          'vue-router',
          'pinia',
        ],
        dts: './src/auto-imports.d.ts',
        // 指明 .d.ts 文件的位置和文件名
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
    resolve: {
      alias,
    },
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@import "@/assets/styles/main.scss";`,
        },
      },
    },
    server: {
      host: '0.0.0.0',
      port: 8e3,
      open: false,
      https: {
        cert: fs.readFileSync(
          path.join(__vite_injected_original_dirname, 'keys/cert.crt'),
        ),
        key: fs.readFileSync(
          path.join(__vite_injected_original_dirname, 'keys/cert.key'),
        ),
      },
      proxy: {
        '/api': {
          target: env.VITE_BASE_URL,
          secure: false,
          headers: {
            Connection: 'keep-alive',
          },
          changeOrigin: true,
          rewrite: (path2) => path2.replace(/^\/api/, ''),
        },
      },
    },
  };
});
export { vite_config_default as default };
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3R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